package unit4_1013.test3.manage;

import java.util.Scanner;

import unit4_1013.test3.cars.Vehicle;

public class Test {

	@SuppressWarnings("resource")
	public static void main(String[] args) {
		//模拟汽车租赁业务
		Scanner scanner = new Scanner(System.in);
		
		VehicleRentBusiness vo = new VehicleRentBusiness();
		vo.init();//数据初始化
		System.out.println("欢迎光临神州汽车租赁");
		System.out.println("可租的汽车种类：\n1.轿车\t2.客车");
		System.out.print("请选择汽车种类：");
		int vehicleType = scanner.nextInt();
		String brand="";
		String model="";
		int seat=0;
		if(vehicleType==1) {
			System.out.println("请选择您要租赁的轿车品牌：1.宝马\t2.奔驰");
			if(scanner.nextInt()==1) {
				brand="宝马";
				System.out.println("请选择您要租赁的宝马型号：1.525Li\t2.530Li");
				model=scanner.nextInt()==1?"525Li":"530Li";
			}else {
				brand="奔驰";
				System.out.println("请选择您要租赁的奔驰型号：1.E200L\t2.S350L");
				model=scanner.nextInt()==1?"E200L":"530Li";
			}			
		}else {
			System.out.println("请选择您要租赁的客车品牌：1.金龙\t2.考斯特");
			if(scanner.nextInt()==1) {
				brand="金龙";
				System.out.println("请选择您要租赁的金龙客车座位数：1.53座\t2.45座");
				seat=scanner.nextInt()==1?53:45;
			}else {
				brand="考斯特";
				System.out.println("请选择您要租赁的考斯特客车座位数：1.22座\t2.37座");
				seat=scanner.nextInt()==1?22:37;
			}			
		}
		Vehicle vehicle = vo.leaseOut(brand, model, seat);
		System.out.print("请输入您要租赁的天数：");
		int days = scanner.nextInt();
		System.out.println("您的租赁费用："+vehicle.calcRent(days)+"元");
		System.out.println("您租赁的汽车信息："+vehicle);
		
	}

}
